home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Caml Light 0.61 / Source / src / runtime / fail.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-24  |  1.3 KB  |  49 lines  |  [TEXT/MPS ]

  1. #ifndef _fail_
  2. #define _fail_
  3.  
  4.  
  5. #include <setjmp.h>
  6. #include "mlvalues.h"
  7.  
  8. #define OUT_OF_MEMORY_EXN 0     /* "exc","Out_of_memory",1 */
  9. #define SYS_ERROR_EXN 1         /* "sys","Sys_error",1 */
  10. #define FAILURE_EXN 2           /* "exc","Failure",3 */
  11. #define INVALID_EXN 3           /* "exc","Invalid_argument",2 */
  12. #define END_OF_FILE_EXN 4       /* "io","End_of_file",1 */
  13. #define ZERO_DIVIDE_EXN 5       /* "int","Division_by_zero",1 */
  14. #define BREAK_EXN 6             /* "sys","Break",2 */
  15. #define NOT_FOUND_EXN 7         /* "exc","Not_found",4 */
  16. #define UNIX_ERROR_EXN 8        /* "unix","Unix_error",1 */
  17. #define GRAPHIC_FAILURE_EXN 9   /* "graphics","Graphic_failure",1 */
  18. #define PARSE_FAILURE_EXN 10    /* "stream","Parse_failure",1 */
  19.  
  20. struct longjmp_buffer {
  21.   jmp_buf buf;
  22. };
  23.  
  24. extern struct longjmp_buffer * external_raise;
  25. extern value exn_bucket;
  26.  
  27. #ifdef ANSI
  28.  
  29. extern void mlraise(value);
  30. extern void raise_with_arg(tag_t tag, value arg);
  31. extern void raise_with_string(tag_t tag, char * msg);
  32. extern void failwith (char *);
  33. extern void invalid_argument (char *);
  34. extern void raise_out_of_memory (void);
  35.  
  36. #else /* ANSI */
  37.  
  38. void mlraise();
  39. void raise_with_arg();
  40. void raise_with_string();
  41. void failwith ();
  42. void invalid_argument ();
  43. void raise_out_of_memory ();
  44.  
  45. #endif /* ANSI */
  46.  
  47.  
  48. #endif /* _fail_ */
  49.